from django_filters import rest_framework
from .models import Staff

class StaffFilter(rest_framework.FilterSet):
    surname = rest_framework.CharFilter(field_name='surname', lookup_expr='exact')
    forename = rest_framework.CharFilter(field_name='forename', lookup_expr='exact')
    identity = rest_framework.CharFilter(field_name='identity', lookup_expr='exact')
    gender = rest_framework.ChoiceFilter(field_name='gender', lookup_expr='exact', choices=Staff.GENDER_CHOICES)
    brith_date = rest_framework.DateFilter(field_name='brith_date', lookup_expr='exact')
    email = rest_framework.CharFilter(field_name='email', lookup_expr='exact')

    class Meta:
        model = Staff
        fields = ['surname', 'forename', 'identity', 'gender', 'brith_date', 'email']
